package com.ruoyi.energize.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.energize.mapper.ProvinceMapper;
import com.ruoyi.energize.domain.Province;
import com.ruoyi.energize.service.IProvinceService;

/**
 * 省会表Service业务层处理
 *
 * @author ruoyi
 * @date 2023-06-07
 */
@Service
public class ProvinceServiceImpl implements IProvinceService
{
    @Autowired
    private ProvinceMapper provinceMapper;

    /**
     * 查询省会表
     *
     * @param id 省会表主键
     * @return 省会表
     */
    @Override
    public Province selectProvinceById(Integer id)
    {
        return provinceMapper.selectProvinceById(id);
    }

    /**
     * 查询省会表列表
     *
     * @param province 省会表
     * @return 省会表
     */
    @DataSource(DataSourceType.ZJPAY)
    @Override
    public List<Province> selectProvinceList(Province province)
    {
        return provinceMapper.selectProvinceList(province);
    }

    /**
     * 新增省会表
     *
     * @param province 省会表
     * @return 结果
     */
    @Override
    public int insertProvince(Province province)
    {
        return provinceMapper.insertProvince(province);
    }

    /**
     * 修改省会表
     *
     * @param province 省会表
     * @return 结果
     */
    @Override
    public int updateProvince(Province province)
    {
        return provinceMapper.updateProvince(province);
    }

    /**
     * 批量删除省会表
     *
     * @param ids 需要删除的省会表主键
     * @return 结果
     */
    @Override
    public int deleteProvinceByIds(Integer[] ids)
    {
        return provinceMapper.deleteProvinceByIds(ids);
    }

    /**
     * 删除省会表信息
     *
     * @param id 省会表主键
     * @return 结果
     */
    @Override
    public int deleteProvinceById(Integer id)
    {
        return provinceMapper.deleteProvinceById(id);
    }
}
